package com.tianzhu.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


/**
 * The persistent class for the CUSTOMERORDER database table.
 * 
 */
@Entity
@Table(name="CUSTOMERORDER")
@NamedQuery(name="Customerorder.findAll", query="SELECT c FROM Customerorder c")
public class Customerorder implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="CUSTOMERORDER_CUSTOMERORDERID_GENERATOR", sequenceName="CUSTOMERORDER_S")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CUSTOMERORDER_CUSTOMERORDERID_GENERATOR")
	@Column(unique=true, nullable=false, precision=38)
	private Long customerorderid;
	
	
	@OneToOne
    @JoinColumn(name = "CARTID")
    private Cart cart;
	
	@OneToOne
    @JoinColumn(name = "CUSTOMERID")
    private Customer customer;

    @OneToOne
    @JoinColumn(name = "BILLINGADDRESSID")
    private Billingaddress billingAddress;

    @OneToOne
    @JoinColumn(name="SHIPPINGADDRESSID")
    private Shippingaddress shippingAddress;


	public Customerorder() {
	}

	public Long getCustomerorderid() {
		return this.customerorderid;
	}

	public void setCustomerorderid(Long customerorderid) {
		this.customerorderid = customerorderid;
	}


    public Cart getCart() {
        return cart;
    }

    public void setCart(Cart cart) {
        this.cart = cart;
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    public Billingaddress getBillingAddress() {
        return billingAddress;
    }

    public void setBillingAddress(Billingaddress billingAddress) {
        this.billingAddress = billingAddress;
    }

    public Shippingaddress getShippingAddress() {
        return shippingAddress;
    }

    public void setShippingAddress(Shippingaddress shippingAddress) {
        this.shippingAddress = shippingAddress;
    }

}